package com.kfm.base.arrays;

import java.util.Arrays;

public class Exer06 {

    public static void main(String[] args) {
        /*
            删除掉其中的 33 ，得到一个新的数组 newNums
         */
        int[] nums = {2, 11, 33, 44, 55, 66, 277};
        int[] newNums = new int[nums.length - 1];

        int index = Arrays.binarySearch(nums, 33);

        System.arraycopy(nums, 0, newNums, 0, index);
        System.arraycopy(nums, index +1, newNums, index, nums.length - index - 1);

        System.out.println(Arrays.toString(newNums));
    }
}
